package com.itheima.mytext04;

public class MyThread extends Thread{
   //手动继承多线程的方法
    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i <100 ; i++) {
            //实现当前线程的休眠
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(getName()+"hello world");
        }

    }
}
